import {
	computed
} from 'vue'
import {
	request,
	retryableRequest
} from '@/common/request';
import {
	useUserStore
} from '@/stores/user.js'
const userType = computed(() => {
	return useUserStore().userType == 2 ? "b-agent-app/app" : "b-merchant-app/app"
})

export const registApi = {
	/**
	 * 分页查询
	 */
	page: (data) => {
		return request({
			url: `/${userType.value}/enroll/j_merchants_product/page`,
			data
		})
	},
	/**
	 * 分页详情查询
	 */
	detailPage: (data) => {
		return request({
			url: `/${userType.value}/enroll/j_merchants_product_detail/page`,
			data
		})
	},
	/**
	 * 根据id查经营详情
	 */
	findId: (data) => {
		return request({
			url: `/${userType.value}/enroll/find_id`,
			data
		})
	},
	/**
	 * 修改经营信息
	 */
	update: (data) => {
		return request({
			url: `/${userType.value}/enroll/update`,
			data
		})
	},
	/**
	 * 保存经营信息
	 */
	save: (data) => {
		return request({
			url: `/${userType.value}/enroll/save`,
			data
		})
	},
	/**
	 * 修改审核状态/发起进件
	 */
	submit: (data) => {
		return request({
			url: `/${userType.value}/enroll/update_check_status`,
			data
		})
	},
	/**
	 * 新增商户进件
	 */
	insertMerchantsProduct: (data) => {
		return request({
			url: `/${userType.value}/enroll/j_merchants_product/insert`,
			data
		})
	},
	/**
	 * 新增经营信息
	 */
	insert: (data) => {
		return request({
			url: `/${userType.value}/enroll/insert`,
			data
		})
	},
	/**
	 * 增加场景
	 */
	insertScene: (data) => {
		return request({
			url: `/${userType.value}/enroll/j_scene/insert_list`,
			data
		})
	},
	/**
	 * 调用进件资料(根据详情编号和通道类型查经营详情)
	 */
	findIdByChannelType: (data) => {
		return request({
			url: `/${userType.value}/enroll/find_by_id_and_channel_type`,
			data
		})
	},
	/**
	 * 获取对私业务银行列表
	 */
	getPersonalBanking: (data) => {
		return request({
			url: `/${userType.value}/enroll/getPersonalBanking`,
			data
		})
	},
	/**
	 * 获取对公业务银行列表
	 */
	getCorporateBanking: (data) => {
		return request({
			url: `/${userType.value}/enroll/getCorporateBanking`,
			data
		})
	},
	/**
	 * 获取对公业务银行列表
	 */
	getBranches: (data) => {
		return request({
			url: `/${userType.value}/enroll/getBranches`,
			data
		})
	},
	/**
	 * 获取省份列表
	 */
	getProvinces: (data) => {
		return request({
			url: `/${userType.value}/enroll/getProvinces`,
			data
		})
	},
	/**
	 * 获取城市列表
	 */
	getCitys: (data) => {
		return request({
			url: `/${userType.value}/enroll/getCitys`,
			data
		})
	},

}